package com.csun.cmny.provider.service;

import com.csun.cmny.base.dto.CacReturnDto;
import com.csun.cmny.provider.model.vo.CareTypeCountVo;
import com.csun.cmny.provider.service.hystrix.CacOldmanFeignHystrix;
import com.csun.cmny.security.feign.OAuth2FeignAutoConfiguration;
import com.csun.cmny.util.wrapper.Wrapper;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(value = "cmny-provider-cac", configuration = OAuth2FeignAutoConfiguration.class ,fallback =CacOldmanFeignHystrix.class)
public interface CacOldmanFeignApi {

    @PostMapping(value = "/api/CacOldman/getEstimateByOld")
    Wrapper<List<Map<String, Object>>> getEstimateByOld(@RequestParam("oldmanId")Integer oldmanId);


    @PostMapping(value = "/api/CacOldman/getCacOldmanInfo")
    Wrapper<List<Map<String, Object>>>getCacOldmanInfo(@RequestParam("oldmanId")Integer oldmanId,
                                                       @RequestParam("cacId")Integer cacId,
                                                       @RequestParam("bigItemId")Integer bigItemId);


    @PostMapping(value = "/api/CacOldman/deleteCacOldman")
    Integer deleteCacOldman(@RequestParam("oldmanId")Integer oldmanId);

    @PostMapping(value = "/api/CacOldman/selectCacOldMnr")
    Wrapper<List<CacReturnDto>> selectCacOldMnr(@RequestParam("oldmanId")Integer oldmanId);

    @PostMapping(value = "/api/CacOldman/queryOldmanNumGroupByCareType")
    Wrapper<List<CareTypeCountVo>> queryOldmanNumGroupByCareType(@RequestParam(value = "oldmanIdList") List<Integer> oldmanIdList);

    @PostMapping(value = "/api/CacOldman/queryNeedDailyEvaluateOldmanIdList")
    Wrapper<List<Integer>> queryNeedDailyEvaluateOldmanIdList(@RequestParam("groupId")  Long groupId);

    @PostMapping(value = "/api/CacOldman/selectCacOldManAll")
    Wrapper<List<Map<String,Object>>> selectCacOldManAll();

    @PostMapping(value = "/api/CacOldman/updateLevelCare")
    Wrapper<Integer> updateLevelCare(@RequestBody List<Map<String,Object>> updateDtos);

    @PostMapping(value = "/api/CacOldman/test")
    Wrapper<Integer> test(@RequestBody List<Map<String,Object>> updateDtos);
}
